package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the SOCIAL_SECURITY database table.
 * 
 */
@Entity
@Table(name="SOCIAL_SECURITY")
@NamedQuery(name="SocialSecurity.findAll", query="SELECT s FROM SocialSecurity s")
public class SocialSecurity implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="SOCIAL_SECURITY_SECURITYID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SOCIAL_SECURITY_SECURITYID_GENERATOR")
	@Column(name="SECURITY_ID")
	private long securityId;
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	@Column(name="SECURITY_CRETORDATE")
	private Timestamp securityCretordate;
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	@Column(name="SECURITY_ENDDATE")
	private Timestamp securityEnddate;

	@Column(name="SECURITY_NAME")
	private String securityName;

	@Column(name="SECURITY_NUMBER_EMPLOYEES")
	private BigDecimal securityNumberEmployees;

	@Column(name="SECURITY_PERSON")
	private String securityPerson;

	@Column(name="SECURITY_REMARK")
	private String securityRemark;
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	@Column(name="SECURITY_STARTDATE")
	private Timestamp securityStartdate;
	@JSONField(format="yyyy-MM-dd HH:mm:ss")
	@Column(name="SECURITY_UPDATEDATE")
	private Timestamp securityUpdatedate;

	//bi-directional many-to-one association to SocialAccount
	@ManyToOne
	@JoinColumn(name="SOCIAL_ID")
	private SocialAccount socialAccount;

	//bi-directional many-to-one association to SocialLeixing
	@ManyToOne
	@JoinColumn(name="SBLX_ID")
	private SocialLeixing socialLeixing;

	//bi-directional many-to-one association to StaffInformation
	@OneToMany(mappedBy="socialSecurity")
	@JSONField(serialize=false)
	private List<StaffInformation> staffInformations;

	public SocialSecurity() {
	}

	public long getSecurityId() {
		return this.securityId;
	}

	public void setSecurityId(long securityId) {
		this.securityId = securityId;
	}

	public Timestamp getSecurityCretordate() {
		return this.securityCretordate;
	}

	public void setSecurityCretordate(Timestamp securityCretordate) {
		this.securityCretordate = securityCretordate;
	}

	public Timestamp getSecurityEnddate() {
		return this.securityEnddate;
	}

	public void setSecurityEnddate(Timestamp securityEnddate) {
		this.securityEnddate = securityEnddate;
	}

	public String getSecurityName() {
		return this.securityName;
	}

	public void setSecurityName(String securityName) {
		this.securityName = securityName;
	}

	public BigDecimal getSecurityNumberEmployees() {
		return this.securityNumberEmployees;
	}

	public void setSecurityNumberEmployees(BigDecimal securityNumberEmployees) {
		this.securityNumberEmployees = securityNumberEmployees;
	}

	public String getSecurityPerson() {
		return this.securityPerson;
	}

	public void setSecurityPerson(String securityPerson) {
		this.securityPerson = securityPerson;
	}

	public String getSecurityRemark() {
		return this.securityRemark;
	}

	public void setSecurityRemark(String securityRemark) {
		this.securityRemark = securityRemark;
	}

	public Timestamp getSecurityStartdate() {
		return this.securityStartdate;
	}

	public void setSecurityStartdate(Timestamp securityStartdate) {
		this.securityStartdate = securityStartdate;
	}

	public Timestamp getSecurityUpdatedate() {
		return this.securityUpdatedate;
	}

	public void setSecurityUpdatedate(Timestamp securityUpdatedate) {
		this.securityUpdatedate = securityUpdatedate;
	}

	public SocialAccount getSocialAccount() {
		return this.socialAccount;
	}

	public void setSocialAccount(SocialAccount socialAccount) {
		this.socialAccount = socialAccount;
	}

	public SocialLeixing getSocialLeixing() {
		return this.socialLeixing;
	}

	public void setSocialLeixing(SocialLeixing socialLeixing) {
		this.socialLeixing = socialLeixing;
	}

	public List<StaffInformation> getStaffInformations() {
		return this.staffInformations;
	}

	public void setStaffInformations(List<StaffInformation> staffInformations) {
		this.staffInformations = staffInformations;
	}

	public StaffInformation addStaffInformation(StaffInformation staffInformation) {
		getStaffInformations().add(staffInformation);
		staffInformation.setSocialSecurity(this);

		return staffInformation;
	}

	public StaffInformation removeStaffInformation(StaffInformation staffInformation) {
		getStaffInformations().remove(staffInformation);
		staffInformation.setSocialSecurity(null);

		return staffInformation;
	}

}